<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>厂家管理</title>
	<meta name="decorator" content="default"/>
	<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
	<script src="https://select2.github.io/vendor/js/jquery.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			/*  $("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			}); */
			
			
				 $(".js-example-basic-single").select2();
		});
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/jiujiu/jiuManufactor?factoClassId=${jiuManufactor.factoClassId}">厂家列表</a></li>
		<li class="active"><a href="${ctx}/jiujiu/jiuManufactor/form?id=${jiuManufactor.id}">厂家<shiro:hasPermission name="jiujiu:jiuManufactor:edit">${not empty jiuManufactor.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="jiujiu:jiuManufactor:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="jiuManufactor" action="${ctx}/jiujiu/jiuManufactor/save" method="post" class="form-horizontal" enctype="multipart/form-data">
		<form:hidden path="id"/>
		<form:hidden path="userId"/>
		<form:hidden path="cid"/>
		<tags:message content="${message}"/>
		
		<div class="control-group">
			<label class="control-label">厂家分类:</label>
			<div class="controls">
				<form:select path="factoClassId" class="js-example-basic-single">
					<c:forEach items="${jiuManufactorClassList}" var="jiuManufactorClass">
	                    <form:option value="${jiuManufactorClass.id}">${jiuManufactorClass.name}</form:option>
					</c:forEach>
         		</form:select>
			</div>
		</div>
		
		
		
		 <div class="control-group">
			<label class="control-label">厂家名称:</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="11" class="required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">封面图片:</label>
			<div class="controls">
				<c:if test="${not empty jiuManufactor.logo}">
					<div class="control"><img src="${ctxUser }/jiu/${jiuManufactor.logo}"   style="width:40px;height:40px"  /><span class="alert" style="margin-left:50px;">大图片建议尺寸：360像素 * 200像素 </span> </div>
				</c:if>
				<div class="control">
					<input type="file" name="picfile" htmlEscape="false"   />     
				</div>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">厂家描述:</label>
			<div class="controls">
				<form:textarea id="manDescribe" htmlEscape="true"  path="manDescribe" rows="4" maxlength="200" class="input-xxlarge required"/>
				<tags:ckeditor replace="manDescribe" uploadPath="/cms/article" />
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">排序:</label>
			<div class="controls">
				<form:input path="sort" htmlEscape="false" class="required" type="number"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">单价:</label>
			<div class="controls">
				<form:input path="price" htmlEscape="false" class="required" type="number"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">库存:</label>
			<div class="controls">
				<form:input path="inventory" htmlEscape="false" class="required" type="number"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单号前缀:</label>
			<div class="controls">
				<form:input path="orderPrefix" htmlEscape="false" class="required" />
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">是否显示:</label>
			<div class="controls">
				<form:radiobutton path="isShow" value="0"/>不显示
        		 <form:radiobutton path="isShow" value="1" checked="checked"/>显示
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否推荐:</label>
			<div class="controls">
				<form:radiobutton path="isRecommend" value="0" checked="checked"/>否
        		 <form:radiobutton path="isRecommend" value="1"/>是
			</div>
		</div>
		
		<div class="form-actions">
			<shiro:hasPermission name="jiujiu:jiuManufactor:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
